import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        int randNum = random.nextInt(101);
        //[0,101),生成一个随机数
        while (true){
            System.out.println("请输入你要输入的数字：");
            int num = scanner.nextInt();
            if(num>randNum){
                System.out.println("猜大了");
            }else if(num<randNum){
                System.out.println("猜小了");
            }else {
                System.out.println("猜对了");
                break;
            }
        }

    }
}//猜数字游戏
